package sz.szsmk.citizencard.ui.newversion.activity

import android.os.Bundle
import android.view.Window
import com.chenenyu.router.annotation.Route
import sz.szsmk.citizencard.R
import sz.szsmk.citizencard.mvp.BasePresenter
import sz.szsmk.citizencard.mvp.MvpView
import sz.szsmk.citizencard.ui.dzsmkavtivity.AppBaseActivity
import sz.szsmk.citizencard.ui.newversion.activity.presenter.ScanQrCodeChcekPresenter
import sz.szsmk.citizencard.ui.newversion.activity.view.ScanQrCodeCheckMvpView
import sz.szsmk.citizencard.util.JumpUtils
import sz.szsmk.citizencard.ui.newversion.config.Constants
import sz.szsmk.citizencard.ui.newversion.fragment.presenter.HomePresenter
import sz.szsmk.citizencard.util.Constant
import javax.inject.Inject

/**
 * author : hyt
 * date : 2020/6/4
 * description :
 */
@Route(Constants.SCANQRCODECHECKACTIVITY)
class ScanQRCodeCheckActivity : AppBaseActivity(), ScanQrCodeCheckMvpView {

    @Inject
    lateinit var presenter: ScanQrCodeChcekPresenter

    override fun getTopTitle() = null

    override fun initPresenters(): Array<BasePresenter<*>>? {
        return arrayOf(presenter)
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        requestWindowFeature(Window.FEATURE_NO_TITLE) //去除这个Activity的标题栏
        super.onCreate(savedInstanceState)
        component.inject(this)

        setContentView(R.layout.activity_paychodecheck)

//        presenter.getGes()
        val bundle = Bundle()
        bundle.putBoolean("isNeedVaild", false)
        bundle.putString("url",Constants.QRCODEACTIVITY)
        JumpUtils.jumptoNatvie(this, Constants.QRCODEACTIVITY, 1,bundle)
        finish()
    }

    override fun getGesSussess(type: String) {
        //检测手势  0  未创建  1 开启  2关闭
        if(type=="0"){
            JumpUtils.jump(this, "gesPasswordSettingActivity", 0)
        }else{
            val bundle = Bundle()
            bundle.putBoolean("isNeedVaild", false)
            bundle.putString("url",Constants.QRCODEACTIVITY)
            JumpUtils.jumptoNatvie(this, "gestureLoginActivity", 0, bundle)
        }
        finish()
    }
}